WPS Office.apk(点击下载) / abaw.java


package defpackage;

import com.fasterxml.jackson.core.util.MinimalPrettyPrinter;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.zip.ZipEntry;
import org.eclipse.paho.client.mqttv3.MqttTopic;

/* renamed from: abaw  reason: default package */
public final class abaw implements abal {
    private static final String TAG = null;

    public static boolean a(aazy aazy, aazv aazv, vpv vpv) {
        String path;
        aoz aoz = new aoz();
        ang d = aoz.d("http://schemas.openxmlformats.org/package/2006/relationships", "", "Relationships");
        vpn e = aazz.e(aazv.CBX);
        Iterator<aazx> it = aazy.iterator();
        while (it.hasNext()) {
            aazx next = it.next();
            ang cp = d.cp("Relationship");
            cp.m("Id", next.id);
            cp.m("Type", next.eWp);
            vpn hds = next.hds();
            if (next.CCe == abab.EXTERNAL) {
                path = hds.toString();
                cp.m("TargetMode", "External");
            } else {
                vpn hds2 = next.hds();
                path = aazz.a(e, hds2, true).getPath();
                if (hds2.fragment != null) {
                    path = path + MqttTopic.MULTI_LEVEL_WILDCARD + hds2.fragment;
                }
                if (path.contains("'")) {
                    path = path.replaceFirst("%23'", "'").replaceAll("%20", MinimalPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR);
                }
            }
            cp.m("Target", path);
        }
        aoz.normalize();
        try {
            vpv.putNextEntry(new ZipEntry(abao.aiq(vpo.WH(aazv.CBX.toString())).getPath()));
            if (!abaa.a(aoz, vpv)) {
                d.Ir();
                return false;
            }
            vpv.closeEntry();
            d.Ir();
            return true;
        } catch (IOException e2) {
            hm.e(TAG, "Cannot create zip entry " + aazv, e2);
            d.Ir();
            return false;
        }
    }

    @Override // defpackage.abal
    public final boolean a(aazt aazt, OutputStream outputStream) throws aazk {
        if (!(outputStream instanceof vpv)) {
            new StringBuilder("Unexpected class ").append(outputStream.getClass().getName());
            ew.eI();
            throw new aazk("ZipOutputStream expected !");
        }
        vpv vpv = (vpv) outputStream;
        if (!aazt.hdl()) {
            return true;
        }
        a(aazt.hde(), aazz.f(aazt.hdn()), vpv);
        return true;
    }
}